
import { SubStateMachine } from "./SubStateMachine";
import { DIRECTION_ORDER_ENUM, PARAMS_NAME_ENUM } from "../Enums";

/**
 * 方向子状态机
 * 特点：需要根据方向参数来切换状态
 */
export default class DirectionSubStateMachine extends SubStateMachine {
  run() {
    const value = this.fsm.getParams(PARAMS_NAME_ENUM.DIRECTION)
    this.currentState = this.stateMachines.get(DIRECTION_ORDER_ENUM[value as number])
  }
}
